package com.netbetter.langzheng.plugin.fileManager.widget.toolbar;

import com.extjs.gxt.ui.client.mvc.AppEvent;
import com.extjs.gxt.ui.client.mvc.Dispatcher;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.netbetter.langzheng.commons.constants.AppEvents;
import com.netbetter.langzheng.plugin.fileManager.widget.BaseEventCenter;

/**
 * @author 嘉陵江里捉鱼 E-mail:tang7259@163.com
 * @Date 创建时间：2008-9-6 下午11:26:06 类说明
 */
public abstract class LangzhengToolBar extends ToolBar {

    public LangzhengToolBar() {
        super();
        Dispatcher.get().addController(new BaseEventCenter() {

            @Override
            public void handleEvent(AppEvent<?> event) {
                if (event.type == AppEvents.ChangeListItem) {
                    updateEvent();
                }
                if (event.type == AppEvents.CutFile) {
                    cutFileEvent();
                }
                if (event.type == AppEvents.CopyFile) {
                    copyFileEvent();
                }
            }
        });
    }

    protected abstract void updateEvent();

    protected abstract void copyFileEvent();

    protected abstract void cutFileEvent();
}
